package com.etu.jsonservices.dto;

/**
 * 
 * @author uye
 * 
 */
public class ErrorJSONResponse extends BaseJSONResponse {

	/**
	 * The associated error code.
	 */
	private String errorCode;

	/**
	 * The description of the error.
	 */
	private String description;

	/**
	 * Creates an instance of an error response. Used to reply back to the
	 * client that the service failed its operation and supplies the error code
	 * and its description.
	 * 
	 * @param originServiceName
	 *            The name of the original service invoked by the client
	 * @param errorCode
	 *            The specific error code that occurred
	 * @param description
	 *            A brief description of the error
	 */
	public ErrorJSONResponse(final String originServiceName,
			final String errorCode, final String description) {
		super(originServiceName);
		this.errorCode = errorCode;
		this.description = description;
	}

	/**
	 * Retrieves the error code.
	 * 
	 * @return The error code
	 */
	public final String getStatusCode() {
		return errorCode;
	}

	/**
	 * Retrieves the error description.
	 * 
	 * @return A brief description of the error
	 */
	public final String getDescription() {
		return description;
	}

}
